<!DOCTYPE html>
<html lang="zh">
<head>
    <th:block th:include="include :: header('资产交易')"/>
</head>
<body class="gray-bg">
<div class="container-fluid">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content">
                    <div class="table-responsive">
                        <table class="table table-bordered table-striped">
                            <thead>
                            <tr>
                                <th>数据日期</th>
                                <th>类型</th>
                                <th>资产名称</th>
                                <th>成本</th>
                                <th>成本价</th>
                                <th>份额/股数</th>
                                <th>市单价</th>
                                <th>市值</th>
                                <th>当前收益</th>
                                <th>历史收益</th>
                            </tr>
                            </thead>
                            <tbody>
                            <th:block th:each="detail,detailStat:${assetDetail.assetDetailList}">
                                <tr>
                                    <td th:if="${detailStat.index == 0}" th:text="${assetDetail.dataDate}"
                                        rowspan="99999"></td>
                                    <td th:text="${detail.typeName}"></td>
                                    <td th:text="${detail.assetName}"></td>
                                    <td th:text="${detail.costOf}"></td>
                                    <td th:text="${detail.costPrice}"></td>
                                    <td th:text="${detail.numberOf}"></td>
                                    <td th:text="${detail.price}"></td>
                                    <td th:text="${detail.marketValue}"></td>
                                    <td th:text="${detail.currentEarnings}"></td>
                                    <td th:text="${detail.historyEarnings}"></td>
                                </tr>
                            </th:block>
                            </tbody>
                        </table>
                        <button type="button" class="btn btn-primary" data-toggle="modal" id="buyAsset">
                            买入资产
                        </button>
                        <button type="button" class="btn btn-danger" data-toggle="modal" id="saleAsset" >
                            卖出资产
                        </button>
                        <button type="button" class="btn btn-warning" data-toggle="modal" id="updatePrice" >
                            更新价格
                        </button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>


<div th:include="include :: footer"></div>
<script th:src="@{/js/jquery-ui-1.10.4.min.js}"></script>
<th:block th:include="include :: bootstrap-table-reorder-columns-js"/>
<script th:inline="javascript">
    var prefix = ctx + "finance/zcjy";
    var datas = [[${@dict.getType('sys_normal_disable')}]];


    $("#buyAsset").click(function () {
        $.modal.open("买入资产","finance/zcjy/buyAsset");
    })

    $("#saleAsset").click(function () {
        $.modal.open("卖出资产","finance/zcjy/saleAsset");
    })

    $("#updatePrice").click(function () {
        $.modal.open("更新市值","finance/zcjy/updatePrice");
    })


</script>


</body>
</html>
